const token_name = 'bufan_token'
const user_info_name = 'user_info'


//存储token
export function setToken(token){
    window.localStorage.setItem(token_name,token)
}
//存储user_info
export function setUserInfo(obj){
    window.localStorage.setItem(user_info_name,JSON.stringify(obj))
}
//取出token
export function getToken(){
    return window.localStorage.getItem(token_name)
}
//取出user_info
export function getUserInfo(){
    return window.localStorage.getItem(user_info_name)
}
//删除token
export function removeToken(){
    return window.localStorage.removeItem(token_name)
}
//删除user_info
export function removeUserInfo(){
    return window.localStorage.removeItem(user_info_name)
}

//全部删除
export function clearAll(){
    removeToken()
    removeUserInfo()
}